﻿@{
    ViewBag.Title = "Modificar";
}

<h2>Modificar</h2>
<form action="/Electro/Modificar" method="post">
    <input type="hidden" name="pos" value="@ViewBag.pos" />

      @{
      string[] names = Enum.GetNames(typeof(CasaElectronica.Controllers.Categoria));
       }

  <label>
  <span>Categoria</span>
  <select name="categoria">
    @for (int i = 0; i<names.Length; i++) 
    {
        var s = names[i];
        if (i == (int)Model.categoria)
        {
            <option value="@i" selected="selected">@s</option> 
        }
        else
        {
            <option value="@i">@s</option>          
        }
    }
    </select>
  </label>
    <br />
    <label>
      <span>Nombre</span>
      <input type="text" name="nombre" value="@Model.nombre" />
    </label>
    <br />
    <label>
      <span>Precio</span>
      <input type="text" name="precio" value="@Model.precio" />
    </label>
    <br />
    <label>
      <span>Cantidad</span>
      <input type="number" name="cantidad" value="@Model.cantidad" />
    </label>
    <br />
    <input type="submit" value="Modificar"/>
  </form>